workspace "Baby"
    architecture "x64"
    startproject "Sandbox"

    configurations
	{
		"Debug",
		"Release",
		"Dist"
	}

outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

-- Include directories relative to root folder (solution directory)
IncludeDir = {}
IncludeDir["GLFW"] = "Baby/vendor/GLFW/include"
IncludeDir["GLAD"] = "Baby/vendor/GLAD/include"
IncludeDir["ImGui"] = "Baby/vendor/imgui"
IncludeDir["glm"] = "Baby/vendor/glm"

include "Baby/vendor/GLFW"
include "Baby/vendor/GLAD"
include "Baby/vendor/imgui"

-- startproject "Sandbox"

project "Baby"
    location "Baby"
    kind "StaticLib"
    language "C++"
    cppdialect "C++17"
    staticruntime "on"

    targetdir ("bin/" .. outputdir .. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

    pchheader "hzpch.h"
    pchsource "Baby/src/hzpch.cpp"

    files
	{
		"%{prj.name}/src/**.h",
        "%{prj.name}/src/**.cpp",
        "%{prj.name}/vendor/glm/glm/**.hpp",
        "%{prj.name}/vendor/glm/glm/**.inl",

	}

    defines
    {
        "_CRT_SECURE_NO_WARNINGS"
    }

    includedirs
    {
        "%{prj.name}/src",
        "%{prj.name}/vendor/spdlog/include",
        "%{IncludeDir.GLFW}",
        "%{IncludeDir.GLAD}",
        "%{IncludeDir.ImGui}",
        "%{IncludeDir.glm}",
    }

    links
	{
		"GLFW",
        "GLAD",
        "ImGui",
		"opengl32.lib"
	}

    filter "system:windows"
        systemversion "latest"

        defines
		{
            "BY_PLATFORM_WINDOWS",
            "BY_BUILD_DLL",
            "GLFW_INCLUDE_NONE",
		}

    filter "configurations:Debug"
	    defines "BY_DEBUG"
        runtime "Debug"
		symbols "on"

	filter "configurations:Release"
		defines "BY_RELEASE"
        runtime "Release"
		optimize "on"

	filter "configurations:Dist"
		defines "BY_DIST"
        runtime "Release"
		optimize "on"

project "Sandbox"
    location "Sandbox"
    kind "ConsoleApp"
    language "C++"
    cppdialect "C++17"
    staticruntime "on"
    
    targetdir ("bin/" .. outputdir .. "/%{prj.name}")
    objdir ("/bin-int/" .. outputdir .. "/%{prj.name}")
    
    files
    {
        "%{prj.name}/src/**.h",
        "%{prj.name}/src/**.cpp"
    }
    
    includedirs
    {
        "Baby/vendor/spdlog/include",
        "Baby/src",
        "%{IncludeDir.ImGui}",
        "%{IncludeDir.glm}",
    }

    links
	{
		"Baby"
	}
    
    filter "system:windows"
        systemversion "latest"
    
        defines
        {
            "BY_PLATFORM_WINDOWS"
        }
        
    filter "configurations:Debug"
        defines "BY_DEBUG"
        runtime "Debug"
        symbols "on"
    
    filter "configurations:Release"
        defines "BY_RELEASE"
        runtime "Release"
        optimize "on"
    
    filter "configurations:Dist"
        defines "BY_DIST"
        runtime "Release"
        optimize "on"

        